//
// Created by baigui on 21-8-31.
//

#ifndef SIMPLE_PLAYER_THREAD_H
#define SIMPLE_PLAYER_THREAD_H


#include "stdint.h"
# include "semaphore.h"
# include "pthread.h"
typedef uint64_t mtime ;

typedef sem_t           sp_sem_t;
typedef pthread_cond_t sp_cond_t;
typedef pthread_mutex_t sp_mutex_t;

//typedef struct
//{
//    pthread_t handle;
//} vlc_thread_t;
typedef struct sp_thread *vlc_thread_t;

mtime mdate(void);

void sp_sem_init (sp_sem_t *sem, unsigned value);

void sp_sem_destroy (sp_sem_t *sem);

int sp_sem_post (sp_sem_t *sem);

void sp_sem_wait (sp_sem_t *sem);

void sp_mutex_init( sp_mutex_t *p_mutex );

void sp_mutex_destroy (sp_mutex_t *p_mutex);

void sp_mutex_lock (sp_mutex_t *p_mutex);

void sp_mutex_unlock (sp_mutex_t *p_mutex);

#endif //SIMPLE_PLAYER_THREAD_H
